/**
 * 
 */
package com.maohi.software.tupuna.ui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.SwingConstants;
import javax.swing.event.AncestorEvent;
import javax.swing.event.AncestorListener;

import com.google.inject.Inject;
import com.google.inject.name.Named;

/**
 * @author heifara
 * 
 */
public class ProfileButton extends ImageButton implements AncestorListener, ActionListener {

	private static final long serialVersionUID = 1L;

	public ProfileButton() {
		this.addAncestorListener(this);
		this.addActionListener(this);
	}

	@Override
	public void actionPerformed(ActionEvent aEvent) {
	}

	@Inject
	protected void initUI(ClassLoader aClassLoader, @Named("userName") String aUserName) {
		this.setText(aUserName);
		this.setHorizontalTextPosition(SwingConstants.LEFT);
		this.setIcon(new ImageIcon(aClassLoader.getResource("com.maohi.software.tupuna.icons/profile24x24.png")));
		super.initUI();
	}

	@Override
	public void ancestorAdded(AncestorEvent aEvent) {
	}

	@Override
	public void ancestorRemoved(AncestorEvent aEvent) {
	}

	@Override
	public void ancestorMoved(AncestorEvent aEvent) {
	}

}
